#ifndef CORE_H
#define CORE_H

#include <QDateTime>
#include <vector>
#include <QString>
#include "CCShape.h"
#include "GameMode.h"
#include "SaveLog.h"
#include "GameInfo.h"



class QTimer;

class Core
{
    Q_OBJECT
public:
    Core(const GameMode&);
    Core(const SaveLog&);
    int initial(const GameMode&);
    int initial(const SaveLog&);

    int startGame();
    int endGame();
    int pauseGame();

    int updateUserAction(const Contour&);
    int saveGame(const QString&);

signals:
    coreUpdateGraphs(const vector< pair<int,CCShape> >&);
    toUpdateGameInfo(const GameInfo&);
    readyToStart();
    gameStartedSignal();
    gameEndedSignal();
    gamePausedSignal();
    gameSavedSignal();

protected:
    int regularUpdate();

private:
    QDateTime finishTime;
    QTimer *updateTimer;
    QTimer *finishTimer;

};

#endif // CORE_H
